using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Overlay
{
    /// <summary>
    /// <para>Spatial Join</para>
    /// <para>Joins attributes from one feature to another based on the spatial relationship. The target features and the joined attributes from the join features are written to the output feature class.</para>
    /// <para>根据空间关系将属性从一个要素连接到另一个要素。目标要素和连接要素中的连接属性将写入输出要素类。</para>
    /// </summary>    
    [DisplayName("Spatial Join")]
    public class SpatialJoin : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SpatialJoin()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_target_features">
        /// <para>Target Features</para>
        /// <para>Attributes of the target features and the attributes from the joined features will be transferred to the output feature class. However, a subset of attributes can be defined in the field map parameter.</para>
        /// <para>目标要素的属性和连接要素中的属性将传输到输出要素类。但是，可以在字段映射参数中定义属性的子集。</para>
        /// </param>
        /// <param name="_join_features">
        /// <para>Join Features</para>
        /// <para>The attributes from the join features will be joined to the attributes of the target features. See the explanation of the Join Operation parameter for details on how the aggregation of joined attributes are affected by the type of join operation.</para>
        /// <para>连接要素中的属性将连接到目标要素的属性。有关联接操作类型如何影响联接属性的聚合的详细信息，请参阅联接操作参数的说明。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>A new feature class containing the attributes of the target and join features. By default, all attributes of target features and the attributes of the joined features will be written to the output. However, the set of attributes to be transferred can be controlled by the field map parameter.</para>
        /// <para>包含目标要素和连接要素属性的新要素类。默认情况下，目标要素的所有属性和连接要素的属性都将写入输出。但是，要传输的属性集可以通过字段映射参数进行控制。</para>
        /// </param>
        public SpatialJoin(object _target_features, object _join_features, object _out_feature_class)
        {
            this._target_features = _target_features;
            this._join_features = _join_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Spatial Join";

        public override string CallName => "analysis.SpatialJoin";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "configKeyword", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue"];

        public override object[] ParameterInfo => [_target_features, _join_features, _out_feature_class, _join_operation.GetGPValue(), _join_type.GetGPValue(), _field_mapping, _match_option.GetGPValue(), _search_radius, _distance_field_name];

        /// <summary>
        /// <para>Target Features</para>
        /// <para>Attributes of the target features and the attributes from the joined features will be transferred to the output feature class. However, a subset of attributes can be defined in the field map parameter.</para>
        /// <para>目标要素的属性和连接要素中的属性将传输到输出要素类。但是，可以在字段映射参数中定义属性的子集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _target_features { get; set; }


        /// <summary>
        /// <para>Join Features</para>
        /// <para>The attributes from the join features will be joined to the attributes of the target features. See the explanation of the Join Operation parameter for details on how the aggregation of joined attributes are affected by the type of join operation.</para>
        /// <para>连接要素中的属性将连接到目标要素的属性。有关联接操作类型如何影响联接属性的聚合的详细信息，请参阅联接操作参数的说明。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Join Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _join_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>A new feature class containing the attributes of the target and join features. By default, all attributes of target features and the attributes of the joined features will be written to the output. However, the set of attributes to be transferred can be controlled by the field map parameter.</para>
        /// <para>包含目标要素和连接要素属性的新要素类。默认情况下，目标要素的所有属性和连接要素的属性都将写入输出。但是，要传输的属性集可以通过字段映射参数进行控制。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Join Operation</para>
        /// <para><xdoc>
        ///   <para>Specifies how joins between the target features and join features will be handled in the output feature class if multiple join features are found that have the same spatial relationship with a single target feature.</para>
        ///   <bulletList>
        ///     <bullet_item>Join one to one—If multiple join features are found that have the same spatial relationship with a single target feature, the attributes from the multiple join features will be aggregated using a field map merge rule. For example, if a point target feature is found within two separate polygon join features, the attributes from the two polygons will be aggregated before being transferred to the output point feature class. If one polygon has an attribute value of 3 and the other has a value of 7, and a Sum merge rule is specified, the aggregated value in the output feature class will be 10. This is the default.</bullet_item><para/>
        ///     <bullet_item>Join one to many—If multiple join features are found that have the same spatial relationship with a single target feature, the output feature class will contain multiple copies (records) of the target feature. For example, if a single point target feature is found within two separate polygon join features, the output feature class will contain two copies of the target feature: one record with the attributes of one polygon and another record with the attributes of the other polygon.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如果发现多个连接要素与单个目标要素具有相同的空间关系，则如何在输出要素类中处理目标要素和连接要素之间的连接。</para>
        ///   <bulletList>
        ///     <bullet_item>一对一连接 - 如果发现多个连接要素与单个目标要素具有相同的空间关系，则将使用字段地图合并规则聚合多个连接要素中的属性。例如，如果在两个单独的面连接要素中找到点目标要素，则两个面中的属性将先进行聚合，然后再传输到输出点要素类。如果一个面的属性值为 3，另一个面的属性值为 7，并且指定了总和合并规则，则输出要素类中的聚合值将为 10。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>一对多连接 - 如果发现多个连接要素与单个目标要素具有相同的空间关系，则输出要素类将包含目标要素的多个副本（记录）。例如，如果在两个单独的面连接要素中找到单个点目标要素，则输出要素类将包含目标要素的两个副本：一条记录具有一个面的属性，另一条记录具有另一个面的属性。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Join Operation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _join_operation_value _join_operation { get; set; } = _join_operation_value._JOIN_ONE_TO_ONE;

        public enum _join_operation_value
        {
            /// <summary>
            /// <para>Join one to one</para>
            /// <para>Join one to one—If multiple join features are found that have the same spatial relationship with a single target feature, the attributes from the multiple join features will be aggregated using a field map merge rule. For example, if a point target feature is found within two separate polygon join features, the attributes from the two polygons will be aggregated before being transferred to the output point feature class. If one polygon has an attribute value of 3 and the other has a value of 7, and a Sum merge rule is specified, the aggregated value in the output feature class will be 10. This is the default.</para>
            /// <para>一对一连接 - 如果发现多个连接要素与单个目标要素具有相同的空间关系，则将使用字段地图合并规则聚合多个连接要素中的属性。例如，如果在两个单独的面连接要素中找到点目标要素，则两个面中的属性将先进行聚合，然后再传输到输出点要素类。如果一个面的属性值为 3，另一个面的属性值为 7，并且指定了总和合并规则，则输出要素类中的聚合值将为 10。这是默认设置。</para>
            /// </summary>
            [Description("Join one to one")]
            [GPEnumValue("JOIN_ONE_TO_ONE")]
            _JOIN_ONE_TO_ONE,

            /// <summary>
            /// <para>Join one to many</para>
            /// <para>Join one to many—If multiple join features are found that have the same spatial relationship with a single target feature, the output feature class will contain multiple copies (records) of the target feature. For example, if a single point target feature is found within two separate polygon join features, the output feature class will contain two copies of the target feature: one record with the attributes of one polygon and another record with the attributes of the other polygon.</para>
            /// <para>一对多连接 - 如果发现多个连接要素与单个目标要素具有相同的空间关系，则输出要素类将包含目标要素的多个副本（记录）。例如，如果在两个单独的面连接要素中找到单个点目标要素，则输出要素类将包含目标要素的两个副本：一条记录具有一个面的属性，另一条记录具有另一个面的属性。</para>
            /// </summary>
            [Description("Join one to many")]
            [GPEnumValue("JOIN_ONE_TO_MANY")]
            _JOIN_ONE_TO_MANY,

        }

        /// <summary>
        /// <para>Keep All Target Features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether all target features will be maintained in the output feature class (known as outer join) or only those that have the specified spatial relationship with the join features (inner join).</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—All target features will be maintained in the output (outer join). This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Only those target features that have the specified spatial relationship with the join features will be maintained in the output feature class (inner join). For example, if a point feature class is specified for the target features, and a polygon feature class is specified for the join features, with a Match Option value of Within, the output feature class will only contain those target features that are within a polygon join feature. Any target features not within a join feature will be excluded from the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是将所有目标要素保留在输出要素类（称为外部连接）中，还是仅保留与连接要素具有指定空间关系的目标要素（内部连接）。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 所有目标要素都将保留在输出（外部连接）中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 只有与连接要素具有指定空间关系的目标要素才会保留在输出要素类（内部连接）中。例如，如果为目标要素指定了点要素类，并且为连接要素指定了面要素类，且匹配选项值为 Within，则输出要素类将仅包含面连接要素内的目标要素。任何不在连接要素中的目标要素都将从输出中排除。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep All Target Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _join_type_value _join_type { get; set; } = _join_type_value._true;

        public enum _join_type_value
        {
            /// <summary>
            /// <para>KEEP_ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ALL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_COMMON</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_COMMON")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Field Map</para>
        /// <para><xdoc>
        ///   <para>Controls which attribute fields will be in the output. By default, all fields from the inputs will be included.</para>
        ///   <para>Fields can be added, deleted, renamed, and reordered, and you can change their properties.</para>
        ///   <para>Merge rules allow you to specify how values from two or more input fields are merged or combined into a single output value. There are several merge rules you can use to determine how the output field will be populated with values.
        ///   <bulletList>
        ///     <bullet_item>First—Use the input fields' first value.  </bullet_item><para/>
        ///     <bullet_item>Last—Use the input fields' last value.  </bullet_item><para/>
        ///     <bullet_item>Join—Concatenate (join) the input field values.  </bullet_item><para/>
        ///     <bullet_item>Sum—Calculate the total of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Mean—Calculate the mean (average) of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Median—Calculate the median (middle) of the input field values.  </bullet_item><para/>
        ///     <bullet_item>Mode—Use the value with the highest frequency.  </bullet_item><para/>
        ///     <bullet_item>Min—Use the minimum value of all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Max—Use the maximum value of all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Standard deviation—Use the standard deviation classification method on all the input field values.  </bullet_item><para/>
        ///     <bullet_item>Count—Find the number of records included in the calculation.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>控制输出中将包含哪些属性字段。默认情况下，将包含输入中的所有字段。</para>
        ///   <para>可以添加、删除、重命名和重新排序字段，并且可以更改其属性。</para>
        /// <para>合并规则允许您指定如何将两个或多个输入字段中的值合并或组合为单个输出值。您可以使用多个合并规则来确定如何使用值填充输出字段。
        ///   <bulletList>
        ///     <bullet_item>第一 - 使用输入字段的第一个值。</bullet_item><para/>
        ///     <bullet_item>最后 （Last） - 使用输入字段的最后一个值。</bullet_item><para/>
        ///     <bullet_item>连接 （Join） - 连接（连接）输入字段值。</bullet_item><para/>
        ///     <bullet_item>求和 （Sum） - 计算输入字段值的总和。</bullet_item><para/>
        ///     <bullet_item>均值 （Mean） - 计算输入字段值的平均值（平均值）。</bullet_item><para/>
        ///     <bullet_item>中位数 - 计算输入字段值的中位数（中间值）。</bullet_item><para/>
        ///     <bullet_item>模式 （Mode） - 使用频率最高的值。</bullet_item><para/>
        ///     <bullet_item>最小值 （Min） - 使用所有输入字段值的最小值。</bullet_item><para/>
        ///     <bullet_item>最大值 （Max） - 使用所有输入字段值的最大值。</bullet_item><para/>
        ///     <bullet_item>标准差 - 对所有输入字段值使用标准差分类方法。</bullet_item><para/>
        ///     <bullet_item>计数 （Count） - 查找计算中包含的记录数。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Map")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_mapping { get; set; } = null;


        /// <summary>
        /// <para>Match Option</para>
        /// <para><xdoc>
        ///   <para>Specifies the criteria that will be used to match rows.</para>
        ///   <bulletList>
        ///     <bullet_item>Intersect—The features in the join features will be matched if they intersect a target feature. This is the default. Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Intersect 3D— The features in the join features will be matched if they intersect a target feature in three-dimensional space (x, y, and z). Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Within a distance—The features in the join features will be matched if they are within a specified distance of a target feature. Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Within a distance geodesic—Same as Within a distance except that geodesic distance is used rather than planar distance. Choose this if your data covers a large geographic extent or the coordinate system of the inputs is unsuitable for distance calculations.</bullet_item><para/>
        ///     <bullet_item>Within a distance 3D—The features in the join features will be matched if they are within a specified distance of a target feature in three-dimensional space. Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Contains—The features in the join features will be matched if a target feature contains them. The target features must be polygons or polylines. For this option, the target features cannot be points, and the join features can only be polygons when the target features are also polygons.</bullet_item><para/>
        ///     <bullet_item>Completely contains—The features in the join features will be matched if a target feature completely contains them. Polygon can completely contain any feature. Point cannot completely contain any feature, not even a point. Polyline can completely contain only polyline and point.</bullet_item><para/>
        ///     <bullet_item>Contains Clementini—This spatial relationship yields the same results as Completely contains with the exception that if the join feature is entirely on the boundary of the target feature (no part is properly inside or outside) the feature will not be matched. Clementini defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.</bullet_item><para/>
        ///     <bullet_item>Within—The features in the join features will be matched if a target feature is within them. It is opposite to Contains. For this option, the target features can only be polygons when the join features are also polygons. Point can be join feature only if point is target.</bullet_item><para/>
        ///     <bullet_item>Completely within—The features in the join features will be matched if a target feature is completely within them. This is opposite to Completely contains.</bullet_item><para/>
        ///     <bullet_item>Within Clementini—The result will be identical to Within except if the entirety of the feature in the join features is on the boundary of the target feature, the feature will not be matched. Clementini defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.</bullet_item><para/>
        ///     <bullet_item>Are identical to—The features in the join features will be matched if they are identical to a target feature. Both join and target feature must be of same shape type—point-to-point, line-to-line, and polygon-to-polygon.</bullet_item><para/>
        ///     <bullet_item>Boundary touches—The features in the join features will be matched if they have a boundary that touches a target feature. When the target and join features are lines or polygons, the boundary of the join feature can only touch the boundary of the target feature and no part of the join feature can cross the boundary of the target feature.</bullet_item><para/>
        ///     <bullet_item>Share a line segment with—The features in the join features will be matched if they share a line segment with a target feature. The join and target features must be lines or polygons.</bullet_item><para/>
        ///     <bullet_item>Crossed by the outline of—The features in the join features will be matched if a target feature is crossed by their outline. The join and target features must be lines or polygons. If polygons are used for the join or target features, the polygon's boundary (line) will be used. Lines that cross at a point will be matched, not lines that share a line segment.</bullet_item><para/>
        ///     <bullet_item>Have their center in—The features in the join features will be matched if a target feature's center falls within them. The center of the feature is calculated as follows: for polygon and multipoint the geometry's centroid is used, and for line input the geometry's midpoint is used. Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Closest—The feature in the join features that is closest to a target feature is matched. See the usage tip for more information. Specify a distance in the Search Radius parameter.</bullet_item><para/>
        ///     <bullet_item>Closest geodesic—Same as Closest except that geodesic distance is used rather than planar distance. Choose this if your data covers a large geographic extent or the coordinate system of the inputs is unsuitable for distance calculations</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于匹配行的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>相交—如果连接要素中的要素与目标要素相交，则这些要素将被匹配。这是默认设置。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>相交 3D—如果连接要素中的要素与三维空间（x、y 和 z）中的目标要素相交，则这些要素将被匹配。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>在距离内 - 如果连接要素中的要素位于目标要素的指定距离内，则将匹配这些要素。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>在距离内测地线 - 与在距离内相同，只是使用测地线距离而不是平面距离。如果您的数据覆盖较大的地理范围或输入的坐标系不适合距离计算，请选择此选项。</bullet_item><para/>
        ///     <bullet_item>在距离内 3D - 如果连接要素中的要素位于三维空间中目标要素的指定距离内，则这些要素将被匹配。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>包含—如果目标要素包含连接要素中的要素，则这些要素将被匹配。目标要素必须是面或折线。对于此选项，目标要素不能是点，并且当目标要素也是面时，连接要素只能是面。</bullet_item><para/>
        ///     <bullet_item>完全包含—如果目标要素完全包含连接要素中的要素，则将匹配这些要素。多边形可以完全包含任何要素。点不能完全包含任何特征，甚至不能包含一个点。折线完全只能包含折线和点。</bullet_item><para/>
        ///     <bullet_item>包含 Clementini - 此空间关系将产生与完全包含相同的结果，不同之处在于，如果连接要素完全位于目标要素的边界上（没有零件在内部或外部正确），则该要素将不匹配。克莱门蒂尼将边界多边形定义为分隔内部和外部的线，将线的边界定义为其端点，并且点的边界始终为空。</bullet_item><para/>
        ///     <bullet_item>内部—如果目标要素位于连接要素中，则将匹配连接要素中的要素。它与 Contains 相反。对于此选项，当连接要素也是面时，目标要素只能是面。仅当点为目标时，点才能成为连接要素。</bullet_item><para/>
        ///     <bullet_item>完全在其中—如果目标要素完全位于连接要素中，则连接要素中的要素将匹配。这与“完全包含”相反。</bullet_item><para/>
        ///     <bullet_item>在 Clementini 内 - 结果将与 Within 相同，除非连接要素中的整个要素位于目标要素的边界上，否则该要素将不匹配。克莱门蒂尼将边界多边形定义为分隔内部和外部的线，将线的边界定义为其端点，并且点的边界始终为空。</bullet_item><para/>
        ///     <bullet_item>相同于—如果连接要素中的要素与目标要素相同，则这些要素将被匹配。连接要素和目标要素必须具有相同的形状类型 - 点对点、线对线和面到面。</bullet_item><para/>
        ///     <bullet_item>边界接触 - 如果连接要素中的要素具有触及目标要素的边界，则这些要素将被匹配。当目标要素和连接要素为直线或面时，连接要素的边界只能接触目标要素的边界，连接要素的任何部分都不能越过目标要素的边界。</bullet_item><para/>
        ///     <bullet_item>共享线段 - 如果连接要素中的要素与目标要素共享线段，则这些要素将被匹配。连接要素和目标要素必须为直线或面。</bullet_item><para/>
        ///     <bullet_item>与轮廓相交 - 如果目标要素与目标要素的轮廓相交，则连接要素中的要素将被匹配。连接要素和目标要素必须为直线或面。如果将面用于连接要素或目标要素，则将使用面的边界（线）。在某个点交叉的线将被匹配，而不是共享线段的线。</bullet_item><para/>
        ///     <bullet_item>使其中心位于连接要素中 - 如果目标要素的中心位于连接要素的中心内，则连接要素中的要素将匹配。要素的中心计算如下：对于面和多点，使用几何的质心，对于线输入，使用几何的中点。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>最近 - 连接要素中最接近目标要素的要素被匹配。有关详细信息，请参阅使用提示。在搜索半径参数中指定距离。</bullet_item><para/>
        ///     <bullet_item>最近测地线 - 与最近测地线相同，只是使用测地线距离而不是平面距离。如果您的数据覆盖较大的地理范围或输入的坐标系不适合进行距离计算，请选择此选项</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Option")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _match_option_value _match_option { get; set; } = _match_option_value._INTERSECT;

        public enum _match_option_value
        {
            /// <summary>
            /// <para>Intersect</para>
            /// <para>Intersect—The features in the join features will be matched if they intersect a target feature. This is the default. Specify a distance in the Search Radius parameter.</para>
            /// <para>相交—如果连接要素中的要素与目标要素相交，则这些要素将被匹配。这是默认设置。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Intersect")]
            [GPEnumValue("INTERSECT")]
            _INTERSECT,

            /// <summary>
            /// <para>Intersect 3D</para>
            /// <para>Intersect 3D— The features in the join features will be matched if they intersect a target feature in three-dimensional space (x, y, and z). Specify a distance in the Search Radius parameter.</para>
            /// <para>相交 3D—如果连接要素中的要素与三维空间（x、y 和 z）中的目标要素相交，则这些要素将被匹配。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Intersect 3D")]
            [GPEnumValue("INTERSECT_3D")]
            _INTERSECT_3D,

            /// <summary>
            /// <para>Within a distance geodesic</para>
            /// <para>Within a distance geodesic—Same as Within a distance except that geodesic distance is used rather than planar distance. Choose this if your data covers a large geographic extent or the coordinate system of the inputs is unsuitable for distance calculations.</para>
            /// <para>在距离内测地线 - 与在距离内相同，只是使用测地线距离而不是平面距离。如果您的数据覆盖较大的地理范围或输入的坐标系不适合距离计算，请选择此选项。</para>
            /// </summary>
            [Description("Within a distance geodesic")]
            [GPEnumValue("WITHIN_A_DISTANCE_GEODESIC")]
            _WITHIN_A_DISTANCE_GEODESIC,

            /// <summary>
            /// <para>Within a distance</para>
            /// <para>Within a distance—The features in the join features will be matched if they are within a specified distance of a target feature. Specify a distance in the Search Radius parameter.</para>
            /// <para>在距离内 - 如果连接要素中的要素位于目标要素的指定距离内，则将匹配这些要素。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Within a distance")]
            [GPEnumValue("WITHIN_A_DISTANCE")]
            _WITHIN_A_DISTANCE,

            /// <summary>
            /// <para>Within a distance 3D</para>
            /// <para>Within a distance 3D—The features in the join features will be matched if they are within a specified distance of a target feature in three-dimensional space. Specify a distance in the Search Radius parameter.</para>
            /// <para>在距离内 3D - 如果连接要素中的要素位于三维空间中目标要素的指定距离内，则这些要素将被匹配。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Within a distance 3D")]
            [GPEnumValue("WITHIN_A_DISTANCE_3D")]
            _WITHIN_A_DISTANCE_3D,

            /// <summary>
            /// <para>Contains</para>
            /// <para>Contains—The features in the join features will be matched if a target feature contains them. The target features must be polygons or polylines. For this option, the target features cannot be points, and the join features can only be polygons when the target features are also polygons.</para>
            /// <para>包含—如果目标要素包含连接要素中的要素，则这些要素将被匹配。目标要素必须是面或折线。对于此选项，目标要素不能是点，并且当目标要素也是面时，连接要素只能是面。</para>
            /// </summary>
            [Description("Contains")]
            [GPEnumValue("CONTAINS")]
            _CONTAINS,

            /// <summary>
            /// <para>Completely contains</para>
            /// <para>Completely contains—The features in the join features will be matched if a target feature completely contains them. Polygon can completely contain any feature. Point cannot completely contain any feature, not even a point. Polyline can completely contain only polyline and point.</para>
            /// <para>完全包含—如果目标要素完全包含连接要素中的要素，则将匹配这些要素。多边形可以完全包含任何要素。点不能完全包含任何特征，甚至不能包含一个点。折线完全只能包含折线和点。</para>
            /// </summary>
            [Description("Completely contains")]
            [GPEnumValue("COMPLETELY_CONTAINS")]
            _COMPLETELY_CONTAINS,

            /// <summary>
            /// <para>Contains Clementini</para>
            /// <para>Contains Clementini—This spatial relationship yields the same results as Completely contains with the exception that if the join feature is entirely on the boundary of the target feature (no part is properly inside or outside) the feature will not be matched. Clementini defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.</para>
            /// <para>包含 Clementini - 此空间关系将产生与完全包含相同的结果，不同之处在于，如果连接要素完全位于目标要素的边界上（没有零件在内部或外部正确），则该要素将不匹配。克莱门蒂尼将边界多边形定义为分隔内部和外部的线，将线的边界定义为其端点，并且点的边界始终为空。</para>
            /// </summary>
            [Description("Contains Clementini")]
            [GPEnumValue("CONTAINS_CLEMENTINI")]
            _CONTAINS_CLEMENTINI,

            /// <summary>
            /// <para>Within</para>
            /// <para>Within a distance—The features in the join features will be matched if they are within a specified distance of a target feature. Specify a distance in the Search Radius parameter.</para>
            /// <para>在距离内 - 如果连接要素中的要素位于目标要素的指定距离内，则将匹配这些要素。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Within")]
            [GPEnumValue("WITHIN")]
            _WITHIN,

            /// <summary>
            /// <para>Completely within</para>
            /// <para>Completely within—The features in the join features will be matched if a target feature is completely within them. This is opposite to Completely contains.</para>
            /// <para>完全在其中—如果目标要素完全位于连接要素中，则连接要素中的要素将匹配。这与“完全包含”相反。</para>
            /// </summary>
            [Description("Completely within")]
            [GPEnumValue("COMPLETELY_WITHIN")]
            _COMPLETELY_WITHIN,

            /// <summary>
            /// <para>Within Clementini</para>
            /// <para>Within Clementini—The result will be identical to Within except if the entirety of the feature in the join features is on the boundary of the target feature, the feature will not be matched. Clementini defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.</para>
            /// <para>在 Clementini 内 - 结果将与 Within 相同，除非连接要素中的整个要素位于目标要素的边界上，否则该要素将不匹配。克莱门蒂尼将边界多边形定义为分隔内部和外部的线，将线的边界定义为其端点，并且点的边界始终为空。</para>
            /// </summary>
            [Description("Within Clementini")]
            [GPEnumValue("WITHIN_CLEMENTINI")]
            _WITHIN_CLEMENTINI,

            /// <summary>
            /// <para>Are identical to</para>
            /// <para>Are identical to—The features in the join features will be matched if they are identical to a target feature. Both join and target feature must be of same shape type—point-to-point, line-to-line, and polygon-to-polygon.</para>
            /// <para>相同于—如果连接要素中的要素与目标要素相同，则这些要素将被匹配。连接要素和目标要素必须具有相同的形状类型 - 点对点、线对线和面到面。</para>
            /// </summary>
            [Description("Are identical to")]
            [GPEnumValue("ARE_IDENTICAL_TO")]
            _ARE_IDENTICAL_TO,

            /// <summary>
            /// <para>Boundary touches</para>
            /// <para>Boundary touches—The features in the join features will be matched if they have a boundary that touches a target feature. When the target and join features are lines or polygons, the boundary of the join feature can only touch the boundary of the target feature and no part of the join feature can cross the boundary of the target feature.</para>
            /// <para>边界接触 - 如果连接要素中的要素具有触及目标要素的边界，则这些要素将被匹配。当目标要素和连接要素为直线或面时，连接要素的边界只能接触目标要素的边界，连接要素的任何部分都不能越过目标要素的边界。</para>
            /// </summary>
            [Description("Boundary touches")]
            [GPEnumValue("BOUNDARY_TOUCHES")]
            _BOUNDARY_TOUCHES,

            /// <summary>
            /// <para>Share a line segment with</para>
            /// <para>Share a line segment with—The features in the join features will be matched if they share a line segment with a target feature. The join and target features must be lines or polygons.</para>
            /// <para>共享线段 - 如果连接要素中的要素与目标要素共享线段，则这些要素将被匹配。连接要素和目标要素必须为直线或面。</para>
            /// </summary>
            [Description("Share a line segment with")]
            [GPEnumValue("SHARE_A_LINE_SEGMENT_WITH")]
            _SHARE_A_LINE_SEGMENT_WITH,

            /// <summary>
            /// <para>Crossed by the outline of</para>
            /// <para>Crossed by the outline of—The features in the join features will be matched if a target feature is crossed by their outline. The join and target features must be lines or polygons. If polygons are used for the join or target features, the polygon's boundary (line) will be used. Lines that cross at a point will be matched, not lines that share a line segment.</para>
            /// <para>与轮廓相交 - 如果目标要素与目标要素的轮廓相交，则连接要素中的要素将被匹配。连接要素和目标要素必须为直线或面。如果将面用于连接要素或目标要素，则将使用面的边界（线）。在某个点交叉的线将被匹配，而不是共享线段的线。</para>
            /// </summary>
            [Description("Crossed by the outline of")]
            [GPEnumValue("CROSSED_BY_THE_OUTLINE_OF")]
            _CROSSED_BY_THE_OUTLINE_OF,

            /// <summary>
            /// <para>Have their center in</para>
            /// <para>Have their center in—The features in the join features will be matched if a target feature's center falls within them. The center of the feature is calculated as follows: for polygon and multipoint the geometry's centroid is used, and for line input the geometry's midpoint is used. Specify a distance in the Search Radius parameter.</para>
            /// <para>使其中心位于连接要素中 - 如果目标要素的中心位于连接要素的中心内，则连接要素中的要素将匹配。要素的中心计算如下：对于面和多点，使用几何的质心，对于线输入，使用几何的中点。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Have their center in")]
            [GPEnumValue("HAVE_THEIR_CENTER_IN")]
            _HAVE_THEIR_CENTER_IN,

            /// <summary>
            /// <para>Closest geodesic</para>
            /// <para>Closest geodesic—Same as Closest except that geodesic distance is used rather than planar distance. Choose this if your data covers a large geographic extent or the coordinate system of the inputs is unsuitable for distance calculations</para>
            /// <para>最近测地线 - 与最近测地线相同，只是使用测地线距离而不是平面距离。如果您的数据覆盖较大的地理范围或输入的坐标系不适合进行距离计算，请选择此选项</para>
            /// </summary>
            [Description("Closest geodesic")]
            [GPEnumValue("CLOSEST_GEODESIC")]
            _CLOSEST_GEODESIC,

            /// <summary>
            /// <para>Closest</para>
            /// <para>Closest—The feature in the join features that is closest to a target feature is matched. See the usage tip for more information. Specify a distance in the Search Radius parameter.</para>
            /// <para>最近 - 连接要素中最接近目标要素的要素被匹配。有关详细信息，请参阅使用提示。在搜索半径参数中指定距离。</para>
            /// </summary>
            [Description("Closest")]
            [GPEnumValue("CLOSEST")]
            _CLOSEST,

        }

        /// <summary>
        /// <para>Search Radius</para>
        /// <para>Join features within this distance of a target feature will be considered for the spatial join. A search radius is only valid when the spatial relationship is specified (the Match Option parameter is set to Intersect, Within a distance, Within a distance geodesic, Have their center in, Closest, or Closest geodesic). For example, using a search radius of 100 meters with the spatial relationship Within a distance will join feature within 100 meters of a target feature. For the three Within a distance relationships, if no value is specified for Search Radius, a distance of 0 is used.</para>
        /// <para>目标要素的此距离内的连接要素将被视为空间连接。仅当指定了空间关系时，搜索半径才有效（匹配选项参数设置为相交、距离内、距离内测地线、中心位于测地线、最近或最近测地线）。例如，使用搜索半径为 100 米的空间关系 在距离内将连接目标要素 100 米以内的要素。对于三个“距离内”关系，如果未为“搜索半径”指定值，则使用距离 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_radius { get; set; } = null;


        /// <summary>
        /// <para>Distance Field Name</para>
        /// <para>The name of a field, which will be added to the output feature class, that contains the distance between the target feature and the closest join feature. This parameter is only valid when the spatial relationship is specified (Match Option is set to Closest or Closest geodesic). The value of this field is -1 if no feature is matched within a search radius. If no field name is specified, the field will not be added to the output feature class.</para>
        /// <para>字段的名称，该字段将添加到输出要素类中，其中包含目标要素与最近的连接要素之间的距离。仅当指定了空间关系（“匹配选项”设置为“最近”或“最近测地线”）时，此参数才有效。如果搜索半径内没有匹配的要素，则此字段的值为 -1。如果未指定字段名称，则不会将该字段添加到输出要素类中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_field_name { get; set; } = null;


        public SpatialJoin SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue);
            return this;
        }

    }

}